<?php
$this->menu = array(
    array('label' => Yii::t('AweCrud.app', 'Manage'), 'icon' => 'icon-pencil icon-white', 'url' => array('/campanias/campania/view/id/' . $id), 'htmlOptions'=>array('class'=>'btn btn-primary')
    ),
);
$campania = Campania::model()->findByPk($id);
?>
<!--Dashboard para la gestion de Campañas-->
<div class="row-fluid">

    <div class="span8">
        <?php $this->renderPartial("dashboardPortlets/_column_campania_general", array('id' => $id)); ?> 

    </div>
    <div class="span4">
        <?php $this->renderPartial("dashboardPortlets/_pie_campania_general", array('id' => $id)); ?>

    </div>

</div>
<?php //$campañaaccion= Campania::model()->accionDeCampania($id, Campanias_Constants::SMS); ?>
<?php if (Campania::model()->accionDeCampania($id, Campanias_Constants::LLAMADA)): ?>
    <div class="widget bluesky">
        <div class="widget-title">
            <h4><i class="icon-phone"></i> Reportes de Llamadas   
            </h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
            </span>
        </div>
        <div class="widget-body">

            <div class="row-fluid">

                <div class="span8">
                    <!--                <div class="highcharts-container" >-->
                    <?php $this->renderPartial("dashboardPortlets/_line_llamada_campania", array('id' => $id)); ?> 
                    <!--</div>-->
                </div>
                <div class="span4">
                    <?php $this->renderPartial("dashboardPortlets/_pie_llamada_campania", array('id' => $id)); ?>

                </div>
            </div>

        </div>
    </div> 
<?php endif; ?>
<?php if (Campania::model()->accionDeCampania($id, Campanias_Constants::EMAIL)): ?>

    <div class="widget green">
        <div class="widget-title">
            <h4><i class="icon-envelope"></i> Reportes de Mail   
            </h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
            </span>
        </div>
        <div class="widget-body">

            <div class="row-fluid">

                <div class="span8 ">
                    <!--                <div class="highcharts-container" >-->
                    <?php $this->renderPartial("dashboardPortlets/_line_mail_campania", array('id' => $id)); ?> 
                    <!--</div>-->
                </div>
                <div class="span4">
                    <?php $this->renderPartial("dashboardPortlets/_pie_mail_campania", array('id' => $id)); ?>

                </div>
            </div>

        </div>
    </div> 
<?php endif; ?>
<?php if (Campania::model()->accionDeCampania($id, Campanias_Constants::SMS)): ?>
    <div class="widget red">
        <div class="widget-title">
            <h4><i class="icon-envelope"></i> Reportes de SMS   
            </h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
            </span>
        </div>
        <div class="widget-body">

            <div class="row-fluid">

                <div class="span8 ">
                    <!--                <div class="highcharts-container" >-->
                    <?php $this->renderPartial("dashboardPortlets/_line_sms_campania", array('id' => $id)); ?> 
                    <!--</div>-->
                </div>
                <div class="span4">
                    <?php $this->renderPartial("dashboardPortlets/_pie_sms_campania", array('id' => $id)); ?>

                </div>
            </div>

        </div>
    </div> 
<?php endif; ?>
<?php if (NoseyEntidadAnswer::model()->de_entidad(Campania::model()->tableName(), $campania->id)->find()): ?>
    <div class="widget blue">
        <div class="widget-title">
            <h4><i class="icon-file-text"></i> Reportes de Formulario   
            </h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
            </span>
        </div>
        <div class="widget-body">

            <div class="row-fluid">

                <div class="span12 ">
                    <?php $this->renderPartial("dashboardPortlets/_column_formulario", array('id' => $id)); ?> 
                </div>

            </div>

        </div>
    </div> 
<?php endif; ?>